<template>
  <div class="block">
    <el-timeline>
      <el-timeline-item v-for="(item,index) of timeline" :key="index" :timestamp="item.timestamp" placement="top">
        <el-card>
          <h4>{{ item.title }}</h4>
          <p>{{ user.name + item.content }}</p>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
export default {
  props: {
    user: {
      type: Object,
      default: () => {
        return {
          name: ""
        }
      }
    }
  },
  data() {
    return {
      timeline: [
        {
          timestamp: '2019/12/01',
          title: '工程接近尾声，开始完善',
          content: ' committed 2019/12/01 20:46'
        },
        {
          timestamp: '2019/11/20',
          title: '后端接口完成50%，开始与前端对接',
          content: ' committed 2019/11/20 20:46'
        },
        {
          timestamp: '2019/10/29',
          title: '前端大致完成，使用mockjs模拟测试',
          content: ' committed 2019/10/29 20:46'
        },
        {
          timestamp: '2019/10/06',
          title: '基于物联网及大数据的中药溯源系统开始动工',
          content: ' committed 2019/10/06 20:46'
        }
      ]
    }
  }
}
</script>
